package mlz.a_static;

//测试自增效果
public class UserDemo {
    public static void main(String[] args) {
        //新增5个对象 -> number = 5
        User user1 = new User();
        User user2 = new User();
        User user3 = new User();
        User user4 = new User();
        User user5 = new User();

        //查看系统创建了多少个User对象
        System.out.println("系统创建的User对象个数为:" + User.number);

    }
}

















